package com.wu.databasedemo.entity;

import java.util.List;

import com.wu.databasedemo.db.helper.AssociationType;
import com.wu.databasedemo.db.helper.Column;
import com.wu.databasedemo.db.helper.Column.ColumnClass;
import com.wu.databasedemo.db.helper.AssociationColumn;
import com.wu.databasedemo.db.helper.NatrualKey;
import com.wu.databasedemo.db.helper.NotPersistent;
import com.wu.databasedemo.db.helper.Table;

@Table(TableName = "wu_order")
public class Order {

	@NatrualKey
	private String orderNo;

	private String name;

	@Column(classType = ColumnClass.DOUBLE)
	private double price;

	@NotPersistent
	private String test;

	@AssociationColumn(foreignClass = Product.class, associationType = AssociationType.One2Many)
	private List<Product> products;

	public Order() {
		super();
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getTest() {
		return test;
	}

	public void setTest(String test) {
		this.test = test;
	}

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	@Override
	public String toString() {
		return "Order [orderNo=" + orderNo + ", name=" + name + ", price="
				+ price + ", test=" + test + ", products=" + products + "]";
	}

}
